package cn.tedu.luban.settle.main.repository.impl;

import cn.tedu.luban.settle.main.converter.SettleConverter;
import cn.tedu.luban.settle.main.mapper.SettleMapper;
import cn.tedu.luban.settle.main.repository.SettleRepository;
import cn.tedu.luban.settle.protocol.dos.SettleBillDO;
import cn.tedu.luban.settle.protocol.param.SettleBillParam;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class SettleRepositoryImpl implements SettleRepository {
    @Autowired
    private SettleMapper settleMapper;
    @Autowired
    private SettleConverter settleConverter;
    @Override public Long countSettleBillByOrderNo(String orderNo) {
        return settleMapper.countSettleBillByOrderNo(orderNo);
    }
    @Override public void batchSave(List<SettleBillParam> params) {
        List<SettleBillDO> settleBillDOS=settleConverter.params2dos(params);
        settleMapper.batchInsert(settleBillDOS);
    }
}
